<?php
namespace application\controllers;

use system\core\Controller;

class Pages extends Controller
{
    public function view( $page = 'home' ) 
    {
        // Does the page even exist?
        if ( ! file_exists(APP_PATH . 'views/pages/'.$page.'.phtml') )
        {
            throw new \Exception('This page doet not exist!', 404);
        }
        
        // Disable auto rendering
        $this->template->disable();
        
        $this->template->writeview('content', 'pages/' . $page);
        $this->template->render();
    }
}

/* End of file Pages.php */